%Generates price impact curves that show $ trade size versus percent (in
%percent, so 1.0 is 1%) for each currency
function fig_price_impact_curves(valsForSumStats2, alphas, Multipliers, TickSizes, optfig)

if optfig.plotfig == 1
    
    % calculate price impact functions
    PriceImpactFunctions = zeros(1000,5);
    Levels = (1e8:1e8:1e11);
    counter = 0;
    while(counter<5)
        counter = counter+1;
        contracts = Levels./(Multipliers(counter)*valsForSumStats2(2,counter));
        PriceImpactFunctions(:,counter) = (100*TickSizes(counter)/valsForSumStats2(2,counter))*(alphas(1,counter)*(contracts.^0.5))';
    end
    
    [fontname,dimension,lw,folder,color,style,marker,markersize,fontsize_tit,fontsize_ax,fontsize_lab,fontsize_leg] = fn_optfig(optfig);
    
    f0 = figure('Units','inches','Position',dimension);
    
    plot(Levels/1E9,PriceImpactFunctions(:,1),'Color',color{1},'LineStyle',style{1},'LineWidth',lw); hold on;
    plot(Levels/1E9,PriceImpactFunctions(:,2),'Color',color{3},'LineStyle',style{2},'LineWidth',lw); hold on;
    plot(Levels/1E9,PriceImpactFunctions(:,3),'Color',color{4},'LineStyle',style{3},'LineWidth',lw); hold on;
    plot(Levels/1E9,PriceImpactFunctions(:,4),'Color',color{5},'LineStyle',style{4},'LineWidth',lw); hold on;
    plot(Levels/1E9,PriceImpactFunctions(:,5),'Color',color{6},'LineStyle',style{5},'LineWidth',lw); hold on;
    
    title('Price Impact Functions', 'interpreter','latex','FontSize',fontsize_tit,'FontName',fontname)
    ylabel('Price Impact (p.p.)','interpreter','latex','FontSize',fontsize_ax,'FontName',fontname);
    xlabel('Trade Size (billions of USD)','interpreter','latex','FontSize',fontsize_ax,'FontName',fontname);
    xtickformat('$%gB')
    ytickformat('percentage')
    grid; axis tight; box off;
    legendCell = {'AUD', 'GBP', 'CAD', 'EUR', 'JPY'};
    legend(legendCell,'interpreter','latex','FontSize',fontsize_leg,'FontName',fontname,'Location','best')
    legend boxoff
end

name = '06_PriceImpactCurves';
print(f0,'-depsc','-painters','-noui','-r600',[folder,name,'.eps'])

end